import 'dart:core';

import 'package:flutter_roujiaosuo/constants/common_constants.dart';
import 'package:flutter_roujiaosuo/flutter_bloc/requests/models/home_top_model.dart';
import 'package:flutter_roujiaosuo/flutter_bloc/requests/request/index.dart';
import 'package:flutter_roujiaosuo/flutter_bloc/requests/request/processor.dart';

class HomeApi {
  Future<HomeTopModel> getHomeTop() async {
    Map<String, String> map = {'action': 'index'};

    BaseResp<HomeTopModel> res = await DioUtil().request(
        Method.get,
        RoujiaosuoApi.Home_Top,
        BaseProcessor(false, fun: HomeTopModel.generateOBJ),
        queryParameters: map);
    return res.data;
  }
}
